const { v4: uuidv4 } = require('uuid');

module.exports = {
  up: async (queryInterface) => {
    const now = new Date();

    // 添加仪表盘菜单（顶级菜单，不属于任何目录）
    const dashboardMenu = {
      id: uuidv4(),
      tenant_id: null,
      parent_id: null,
      name: 'dashboard',
      title: '仪表盘',
      english: 'Dashboard',
      type: 'menu',
      path: '/',
      component: 'Dashboard/index',
      icon: 'solar:chart-2-bold',
      permission: null, // 所有人都可以访问
      order_num: 1, // 排在最前面
      visible: true,
      status: true,
      cache: true,
      redirect: null,
      created_at: now,
      updated_at: now,
    };

    await queryInterface.bulkInsert('menus', [dashboardMenu]);
  },

  down: async (queryInterface) => {
    await queryInterface.bulkDelete('menus', {
      name: 'dashboard',
    });
  },
};

